// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity;

import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
import android.database.Cursor;
import android.os.Bundle;
import android.os.Handler;
import android.text.Html;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.AutoCompleteTextView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.nnee.p_fk.cls_ActivityEx;
import com.nnee.p_fk.cls_k;
import com.nnee.p_pr.p_activity.p_a.cls_ab;
import com.nnee.p_pr.p_activity.p_a.cls_p;
import com.nnee.p_pr.p_atom.cls_ad;
import com.nnee.p_pr.p_atom.cls_b;
import com.nnee.p_pr.p_atom.cls_g;
import com.nnee.p_pr.p_atom.cls_u;
import com.nnee.p_pr.p_c.cls_l;
import com.nnee.p_pr.p_prot.cls_d;
import com.nnee.p_pr.cls_v;
import java.util.LinkedList;
import java.util.regex.Pattern;

// Referenced classes of package com.nnee.p_pr.p_activity:
//            ec, fo, fr, fq, 
//            ft, fs, fp, CustomTabActivity, 
//            cj, MBlogBindActivity

public class cls_CustomListViewActivity extends cls_ActivityEx
    implements cls_ec
{

    public cls_CustomListViewActivity()
    {
        f = 0;
        i = null;
        j = null;
        k = null;
        o = false;
        p = null;
        r = null;
        H = null;
        J = new cls_fo(this);
        L = new cls_fr(this);
        M = new cls_fq(this);
        d = new cls_ft(this);
        e = new cls_fs(this);
    }

    public static Intent a(Context context)
    {
        return new Intent(context, com.nnee.p_pr.p_activity.cls_CustomListViewActivity.class);
    }

    static AutoCompleteTextView a(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.x;
    }

    static String a(cls_CustomListViewActivity customlistviewactivity, String s1)
    {
        customlistviewactivity.h = s1;
        return s1;
    }

    private void a(int i1, cls_u u1, String s1, String s2)
    {
        switch(i1)
        {
        case 303:
        	 f = com.nnee.p_pr.cls_v.a().b(u1);
        	break;
        case 304:
        	f = com.nnee.p_pr.cls_v.a().a(s1);
        	break;
        case 309:
        	f = com.nnee.p_pr.cls_v.a().a(u1);
        	break;
        case 1100:
        	 f = com.nnee.p_pr.cls_v.a().d(s1, s2, l);
       
        	break;
        case 1105:
        	 f = com.nnee.p_pr.cls_v.a().e(s1, s2, l);
        	break;
        	default:
        		return;
            	 
        }
    	 n.add(new Integer(f));
      
    }

    static void a(cls_CustomListViewActivity customlistviewactivity, int i1, cls_u u1, String s1, String s2)
    {
        customlistviewactivity.a(i1, u1, s1, s2);
    }

    static void a(cls_CustomListViewActivity customlistviewactivity, cls_d d1)
    {
        customlistviewactivity.a(d1);
    }

    static void a(cls_CustomListViewActivity customlistviewactivity, cls_d d1, boolean flag)
    {
        customlistviewactivity.a(d1, flag);
    }

    static void a(cls_CustomListViewActivity customlistviewactivity, boolean flag)
    {
        customlistviewactivity.b(flag);
    }

    private void a(cls_d d1)
    {
        String s2;
        String s1 = i;
        i = null;
        if(d1.g == null)
        	return;
        s2 = d1.g.b(cls_g.iEPageNext);
        if(TextUtils.isEmpty(s2))
        	return;
        if(s2.equals(s1))
        {
            i = null;
            return;
        }
        
        i = s2;
    }

    private void a(cls_d d1, boolean flag)
    {
    	String s1;
    	int j1 =0;
        if(flag) {
        	s.b(d1.h);
        	return;
        } else {
        	s.a();
            s.b(d1.h);
            if(d1.h.size() != 0) {
            	int i1;
                if(!com.nnee.p_fk.cls_k.a(this).c())
                    return;
                i1 = 0x7f0a004a;
                
                Object aobj[] = new Object[1];
                aobj[0] = h;
                s1 = getString(i1, aobj);
                
                if(A != null)
                {
                    A.setText(Html.fromHtml(s1));
                    A.setVisibility(0);
                    D.setVisibility(8);
                }
            } else {
            	if(!com.nnee.p_fk.cls_k.a(this).c()) {
            		j1 = 0x7f0a0047;
            	} else {
            		j1 = 0x7f0a0046;
            	}
            	
            	Object aobj1[] = new Object[1];
                aobj1[0] = h;
                s1 = getString(j1, aobj1);
       
                if(A != null)
                {
                    A.setText(Html.fromHtml(s1));
                    A.setVisibility(0);
                    D.setVisibility(8);
                }
            }
            
            
            
        }
 
    }

    private boolean a(cls_b b1)
    {
        boolean flag = false;
        switch(cls_fp.a[b1.ordinal()])
        {
        case 1:
        	flag = com.nnee.p_pr.p_c.cls_l.a(p, com.nnee.p_b.p_a.cls_d.h().c(), 1);
        	break;
        case 2:
        	flag = com.nnee.p_pr.p_c.cls_l.a(p, com.nnee.p_b.p_a.cls_d.h().c(), 3);
        	break;
        default:
        	break;
        }
        
        return flag;
         
    }

    static ImageView b(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.y;
    }

    static void b(cls_CustomListViewActivity customlistviewactivity, String s1)
    {
        customlistviewactivity.c(s1);
    }

    private void b(boolean flag)
    {
        if(flag)
        {
            u.setVisibility(0);
            v.setVisibility(0);
            w.setText(0x7f0a009d);
        } else
        {
            u.setVisibility(8);
        }
    }

    static boolean b(cls_CustomListViewActivity customlistviewactivity, boolean flag)
    {
        customlistviewactivity.o = flag;
        return flag;
    }

    static ImageView c(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.z;
    }

    private void c(String s1)
    {
        String s2 = j;
        if(s1 != null && s1.length() > 200)
            s1 = s1.substring(0, 200);
        s.a();
        a(1100, null, s2, s1);
        f();
 
        return;
        
    }

    static Context d(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.p;
    }

    static InputMethodManager e(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.q;
    }

    static Pattern e()
    {
        return K;
    }

    static cls_b f(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.l;
    }

    private void f()
    {
        android.app.Activity activity = getParent();
        if(activity instanceof cls_CustomTabActivity)
            ((cls_CustomTabActivity)activity).b();
    }

    static String g(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.h;
    }

    private void g()
    {
        android.app.Activity activity = getParent();
        if(activity instanceof cls_CustomTabActivity)
            ((cls_CustomTabActivity)activity).c();
    }

    static cls_p h(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.s;
    }

    private void h()
    {
        r = (ListView)findViewById(0x7f0d0070);
        t = LayoutInflater.from(this).inflate(0x7f030008, null);
        r.addFooterView(t);
        u = (LinearLayout)t.findViewById(0x7f0d001a);
        v = (ProgressBar)t.findViewById(0x7f0d001b);
        w = (TextView)t.findViewById(0x7f0d001c);
        A = (TextView)findViewById(0x7f0d006c);
        x = (AutoCompleteTextView)findViewById(0x7f0d0072);
        y = (ImageView)findViewById(0x7f0d0073);
        z = (ImageView)findViewById(0x7f0d0074);
        B = (LinearLayout)findViewById(0x7f0d0075);
        C = (TextView)findViewById(0x7f0d0076);
        D = (LinearLayout)findViewById(0x7f0d006d);
        E = (TextView)findViewById(0x7f0d006e);
        F = (TextView)findViewById(0x7f0d006f);
    }

    static LinearLayout i(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.D;
    }

    static TextView j(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.A;
    }

    static TextView k(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.F;
    }

    static String l(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.k;
    }

    static void m(cls_CustomListViewActivity customlistviewactivity)
    {
        customlistviewactivity.u();
    }

    static void n(cls_CustomListViewActivity customlistviewactivity)
    {
        customlistviewactivity.v();
    }

    static void o(cls_CustomListViewActivity customlistviewactivity)
    {
        customlistviewactivity.g();
    }

    static LinkedList p(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.n;
    }

    static ListView q(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.r;
    }

    static View r(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.t;
    }

    private void r()
    {
        s = new cls_p(p);
        s.a(m);
        s.a(g);
        r.setAdapter(s);
        G = new cls_ab(p);
        H = com.nnee.p_pr.p_c.cls_l.a(this);
        I = new cls_cj(this, new Handler());
        H.registerContentObserver(I);
 
        return;
      
    }

    static Cursor s(cls_CustomListViewActivity customlistviewactivity)
    {
        return customlistviewactivity.H;
    }

    private void s()
    {
        r.setOnItemClickListener(M);
        r.setOnScrollListener(d);
        s.a(L);
        x.addTextChangedListener(J);
        x.setAdapter(G);
        x.setEnabled(false);
        C.setOnClickListener(L);
        y.setOnClickListener(L);
        z.setOnClickListener(L);
        z.setClickable(false);
        z.setEnabled(false);
 
        return;
     
    }

    private void t()
    {
        switch(cls_fp.a[l.ordinal()])
        {
        case 1:
        	if(!a(cls_b.cNetEaseMblog))
            {
                B.setVisibility(0);
                C.setText(0x7f0a00c6);
                x.setEnabled(false);
                x.setHint("");
                x.setText("");
                break; /* Loop/switch isn't completed */
            }
        	
        	 B.setVisibility(8);
             x.setEnabled(true);
             x.setHint(0x7f0a00c2);
             x.setInputType(1);
        	break;
        case 2:
        	
        	if(!a(cls_b.bSinaMblog))
            {
                B.setVisibility(0);
                C.setText(0x7f0a00c7);
                x.setEnabled(false);
                x.setHint("");
                x.setText("");
            } else
            {
                B.setVisibility(8);
                x.setEnabled(true);
                x.setHint(0x7f0a00c3);
                x.setInputType(1);
            }
        	break;
        case 3:
        	x.setEnabled(true);
            x.setHint(0x7f0a00c4);
            x.setInputType(2);
            B.setVisibility(8);
        	break;
        case 4:
        	
        	x.setEnabled(true);
            x.setHint(0x7f0a00c5);
            x.setInputType(1);
            B.setVisibility(8);
        	break;
        default:
        	break;
        }
        
        
     
    }

    private void u()
    {
        switch(cls_fp.a[l.ordinal()])
        {
        case 1:
        	cls_MBlogBindActivity.a(p, 1);
        	break;
        case 2:
        	cls_MBlogBindActivity.a(p, 3);
        	break;
        default:
        	break;
        }
        
    }

    private void v()
    {
        if(!o && i != null)
        {
            o = true;
            a(1105, null, i, h);
            r.addFooterView(t);
            f();
            b(true);
        }
    }

    public String a()
    {
        String s1;
        if(x != null)
            s1 = x.getText().toString();
        else
            s1 = null;
        return s1;
    }

    public void a(String s1)
    {
        if(x != null)
        {
            x.setText(s1);
            AutoCompleteTextView autocompletetextview = x;
            int i1;
            if(s1 != null)
                i1 = s1.length();
            else
                i1 = 0;
            autocompletetextview.setSelection(i1);
            x.setDropDownHeight(0);
        }
    }

    public boolean b()
    {
        boolean flag;
        if(B.getVisibility() == 0)
            flag = false;
        else
            flag = true;
        return flag;
    }

    void c()
    {
        H.requery();
        if(H.moveToFirst()) {
        	while(true)
        	{
	        	switch(H.getInt(4))
	        	{
	        	case 1:
	        		 if(l == cls_b.cNetEaseMblog)
	        	        {
	        	            B.setVisibility(8);
	        	            x.setEnabled(true);
	        	            x.setHint(0x7f0a00c2);
	        	            x.setInputType(1);
	        	        }
	        		break;
	        	case 3:
	        		 if(l == cls_b.bSinaMblog)
	        	        {
	        	            B.setVisibility(8);
	        	            x.setEnabled(true);
	        	            x.setHint(0x7f0a00c3);
	        	            x.setInputType(1);
	        	        }
	        		break;
	        	case 2:
	        		default:
	        			
	        		break;
	        	}
	        	
	        	if(H.moveToNext()) {continue;} else{return;}
        	}
        }
 
    }

    public void onCreate(Bundle bundle)
    {
        super.onCreate(bundle);
        setContentView(0x7f030024);
        p = this;
        com.nnee.p_pr.cls_v.a().a(e);
        m = new LinkedList();
        n = new LinkedList();
        g = com.nnee.p_b.p_a.cls_d.f();
        q = (InputMethodManager)getSystemService("input_method");
        Intent intent = getIntent();
        if(intent != null)
        {
            j = intent.getStringExtra(a);
            l = (cls_b)intent.getSerializableExtra(b);
            k = intent.getStringExtra(c);
        }
        h();
        r();
        s();
        k();
        t();
    }

    public void onDestroy()
    {
        super.onDestroy();
        com.nnee.p_pr.cls_v.a().b(e);
        com.nnee.p_img.cls_d.a().a(g);
        if(H != null)
        {
            H.unregisterContentObserver(I);
            H.close();
        }
        if(G != null)
            G.changeCursor(null);
        v.setVisibility(8);
        v = null;
        n.clear();
        m.clear();
        s = null;
        L = null;
        d = null;
        M = null;
        r = null;
        i = null;
        t = null;
        u = null;
        v = null;
        w = null;
        k = null;
        p = null;
 
        return;
     
    }

    private static Pattern K = Pattern.compile("^\\d+$");
    public static String a = "searchhref";
    public static String b = "customtype";
    public static String c = "customtitle";
    private TextView A;
    private LinearLayout B;
    private TextView C;
    private LinearLayout D;
    private TextView E;
    private TextView F;
    private cls_ab G;
    private Cursor H;
    private ContentObserver I;
    private TextWatcher J;
    private android.view.View.OnClickListener L;
    private android.widget.AdapterView.OnItemClickListener M;
    android.widget.AbsListView.OnScrollListener d;
    com.nnee.p_pr.cls_b e;
    private int f;
    private int g;
    private String h;
    private String i;
    private String j;
    private String k;
    private cls_b l;
    private LinkedList m;
    private LinkedList n;
    private boolean o;
    private Context p;
    private InputMethodManager q;
    private ListView r;
    private cls_p s;
    private View t;
    private LinearLayout u;
    private ProgressBar v;
    private TextView w;
    private AutoCompleteTextView x;
    private ImageView y;
    private ImageView z;

}
